package framework;

public class GameCamera {
	
	public static float CAMERA_WIDTH = 960;
	public static float CAMERA_HEIGHT = 640;
	
	public static void setSize(float width, float height) {
		CAMERA_WIDTH = width;
		CAMERA_HEIGHT = height;
	}
	
	public static float X = 0;
	public static float Y = 0;
	
	public static void setPosition(float x, float y) {
			X = x;
			Y = y;
	}
	
	public static void up(float dy) {
		Y += dy;
		if (Y > GameConfig.BASE_HEIGHT - CAMERA_HEIGHT) {
			Y = GameConfig.BASE_HEIGHT - CAMERA_HEIGHT;
		}
	}
	
	public static void down(float dy) {
		Y -= dy;
		if (Y < 0) {
			Y = 0;
		}
	}
	
	public static void right(float dx) {
		X += dx;
		if (X > GameConfig.BASE_WIDTH - CAMERA_WIDTH) {
			X = GameConfig.BASE_WIDTH - CAMERA_WIDTH;
		}
	}
	
	public static void left(float dx) {
		X -= dx;
		if (X < 0) {
			X = 0;
		}
	}

}
